<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activIdsAdmin']))
{
	header("Location:checkLogin.php");
}
else
{
  $userId = ($_SESSION['s_activIdsAdmin']);
  $docArray = array();
  $i=0;
  if($_GET['userId'] > 0 && $_GET['contractId'] > 0)
  {
  echo  $selectDoc = "SELECT userId,invoiceNo
                       FROM userdoc
                      LEFT JOIN invoice  ON invoice .invoiceId = userdoc.invoiceId
                      WHERE userdoc.userId = ".$_REQUEST['userId']."
                     AND userdoc.contractId = ".$_REQUEST['contractId'];
    $selectDocRes = mysql_query($selectDoc);
    while($docRow = mysql_fetch_array($selectDocRes))
    {
    	$docArray['invoiceNo'][$i] 	= $docRow['invoiceNo'];
      $i++;
    }
  }
  include("bottom.php");
  $smarty->assign("docArray",$docArray);
  $smarty->display("mydoc.tpl");
}
?>